<style scoped>
.block {
  margin-top: 20px;
  padding: 10px;
}

.titleblock {
  left: 11px;
  top: 89px;
  width: 88px;
  line-height: 20px;
  border-radius: 5px 5px 1px 1px;
  background-color: rgba(24, 144, 255, 100);
  color: rgba(255, 255, 255, 100);
  font-size: 14px;
  text-align: center;
  padding-top: 5px;
  padding-bottom: 5px;
  font-family: Arial;
}

ul li {
  padding: 5px;
  border-bottom: 1px solid #ddd;
}
</style>

<template>
  <div>
    <h1>home</h1>
    <ul>
      <li>
        <a href="/routerhelp">/routerhelp</a>
      </li>
      <li>
        <a href="/ngnixmanange">/ngnixmanange</a>
      </li>
      <li>
        <el-button type="text" href="localhost:18011/"
                   @click="triggerStartFuzzySystem"
        >开启并且开始模糊查询系统
        </el-button>
      </li>
      <li>
        <a href="/codegerenate1">/codegerenate1</a>
      </li>

      <li>
        <li>
          <a href="/databaseui">数据库操作ui</a>
        </li>
      </li>

      <li>
        <li>
          <a href="/systemgenerete">系统代码生成</a>
        </li>
      </li>
      <li>
        <li>
          <a href="/swagger1">swaggerui</a>
        </li>
      </li>
    </ul>
  </div>
</template>
<script>
import * as axios from 'axios';

export function createA(href, target) {
  var a = document.createElement('a');
  a.setAttribute('href', href);
  a.setAttribute('target', target || '_blank');
  a.setAttribute('id', 'startTelMedicine');
  // 防止反复添加
  if (document.getElementById('startTelMedicine')) {
    document.body.removeChild(document.getElementById('startTelMedicine'));
  }
  document.body.appendChild(a);
  a.click();
}

export default {
  data() {
    return {};
  },
  methods: {
    async triggerStartFuzzySystem() {
      axios.get('/api/start_node_fuzzsysystem');
      setTimeout(() => {
        createA('http://localhost:18011/');
      });
    },
  },
};
</script>
